<template>
  <div class="home">
    <div class="welcome-content">
      <div class="welcome-card">
        <div class="welcome-icon">
          <el-icon size="60" color="#409EFF"><WaterIcon /></el-icon>
        </div>
        <h1>欢迎使用水云鉴水利质检系统</h1>
        <p class="welcome-description">专业的水质监测和管理平台，提供实时数据采集、可视化展示、设备管理等功能</p>
        <div class="feature-grid">
          <div class="feature-item" @click="navigateToModule('/water-quality/device')">
            <div class="feature-icon" style="background-color: #ECF5FF;">
              <el-icon size="24" color="#409EFF"><Monitor /></el-icon>
            </div>
            <h3>设备管理</h3>
            <p>实时监控设备状态，远程控制设备操作</p>
          </div>
          <div class="feature-item" @click="navigateToModule('/water-quality/visualization')">
            <div class="feature-icon" style="background-color: #FDF6EC;">
              <el-icon size="24" color="#E6A23C"><DataLine /></el-icon>
            </div>
            <h3>可视化界面</h3>
            <p>直观展示监测数据，支持多种图表类型</p>
          </div>
          <div class="feature-item" @click="navigateToModule('/water-quality/system')">
            <div class="feature-icon" style="background-color: #FEF0F0;">
              <el-icon size="24" color="#F56C6C"><Setting /></el-icon>
            </div>
            <h3>系统管理</h3>
            <p>用户权限管理，系统配置维护</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'
import { 
  Setting as WaterIcon, 
  Monitor, 
  DataLine, 
  Setting
} from '@element-plus/icons-vue'

const router = useRouter()

// 功能卡片导航
const navigateToModule = (path) => {
  router.push(path)
}
</script>

<style scoped>
.home {
  height: 100%;
  background: #f5f7fa;
  font-family: 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.welcome-content {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 120px);
}

.welcome-card {
  text-align: center;
  max-width: 900px;
  width: 100%;
  padding: 40px 30px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
  border: 1px solid #ebeef5;
}

.welcome-icon {
  margin-bottom: 20px;
}

.welcome-card h1 {
  margin: 20px 0;
  color: #333333;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.4;
}

.welcome-description {
  margin: 15px 0 30px;
  color: #606266;
  font-size: 15px;
  line-height: 1.6;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.feature-item {
  padding: 20px 15px;
  border-radius: 12px;
  background: #fafafa;
  border: 1px solid #ebeef5;
  transition: all 0.3s ease;
  cursor: pointer;
  text-align: center;
}

.feature-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  border-color: #dcdfe6;
  background: #ffffff;
}

.feature-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
}

.feature-item h3 {
  margin: 15px 0 10px;
  color: #333333;
  font-size: 16px;
  font-weight: 600;
}

.feature-item p {
  margin: 0;
  color: #606266;
  font-size: 13px;
  line-height: 1.5;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .welcome-card {
    padding: 30px 20px;
  }
  
  .welcome-card h1 {
    font-size: 20px;
  }
  
  .welcome-description {
    font-size: 14px;
  }
  
  .feature-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .feature-item {
    padding: 15px 10px;
  }
  
  .feature-item h3 {
    font-size: 15px;
  }
  
  .feature-item p {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .welcome-card {
    padding: 20px 15px;
  }
  
  .welcome-card h1 {
    font-size: 18px;
  }
  
  .welcome-description {
    font-size: 13px;
    margin: 10px 0 20px;
  }
  
  .feature-item {
    padding: 12px 8px;
  }
  
  .feature-icon {
    width: 40px;
    height: 40px;
  }
  
  .feature-item h3 {
    font-size: 14px;
    margin: 10px 0 8px;
  }
}
</style>